<script setup>

import {useRouter} from "vue-router"

import MenuItem from "@/components/menuItem.vue";

const router = useRouter()

const props = defineProps({
  isCollapse: {
    type: Boolean,
    default: false,
  },
  menu: {
    type: Array,
    required: true,
    default: []
  }
})

</script>

<template>
  <el-menu
      :default-active="router.currentRoute.value.fullPath === '/' ? '/index' : router.currentRoute.value.fullPath"
      :collapse="props.isCollapse"
      style="border-right: none"
      router
  >
    <!--菜单项-->
    <menu-item :menu="item" v-for="item in menu"/>
  </el-menu>
</template>

<style scoped lang="scss">

</style>
